home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VELENG10.ZIP / ERROR.C < prev    next >
C/C++ Source or Header  |  1997-07-27  |  1KB  |  48 lines

  1. // ****************************************************************************
  2. // *                                                                          *
  3. // *                      Velena Source Code V1.0                             *
  4. // *                   Written by Giuliano Bertoletti                         *
  5. // *       Based on the knowledged approach of Louis Victor Allis             *
  6. // *   Copyright (C) 1996-97 by Giuliano Bertoletti & GBE 32241 Software PR   *
  7. // *                                                                          *
  8. // ****************************************************************************
  9.  
  10. // Portable engine version.
  11. // read the README file for further informations.
  12.  
  13. // ==========================================================================
  14.  
  15.  
  16. #include <stdio.h>
  17. #include <string.h>
  18. #include <stdlib.h>
  19. #include <malloc.h>
  20.  
  21. #include "connect4.h"
  22. #include "pnsearch.h"
  23. #include "proto.h"
  24.  
  25. extern struct board *brd;
  26.  
  27. void fatal_error(char *erstring)
  28.     {
  29.         FILE *h1;
  30.         short x;
  31.  
  32.     h1=fopen(LOGFILE,"a+");
  33.     fprintf(h1,"\n*** Fatal Error *** : %s\n",erstring);
  34.  
  35.         if(brd && brd->filled>0)
  36.         {
  37.         for(x=0;x<brd->filled;x++)
  38.             putc(brd->moves[x]+0x31,h1);
  39.  
  40.         fprintf(h1,"\n\n");
  41.         }
  42.  
  43.     printf("\n");
  44.     printf("Fatal Error: %s\n",erstring);
  45.     exit(0);
  46.     }
  47.  
  48.